#ifndef __AW_WORLD
#define __AW_WORLD


class AW_World : public AW_Entity {
	friend class AW_AgentsSensor;
	friend class AW_AgentsPositionSensor;

public:
	AW_World();
	AW_World(FILE *fp);

	virtual ~AW_World();

	virtual bool is_a(char *c);
	virtual bool is_a(Symbol *c);

	virtual bool load(FILE *fp);
	virtual bool save(FILE *fp);

	virtual void pause(void);
	virtual void unpause(void);

	virtual void beforedraw(void);
	virtual void draw(void);
	virtual void draw_world(void);
	virtual void draw_shadows(void);
	virtual void afterdraw(void);

	virtual void actualize(float time,float timeinc);
	
	virtual void sendmessage(AW_Message *m);

	virtual bool MouseClick(int x,int y);
	virtual bool KeyboardEvent(int key);

	AW_Agent *FindAgent(Symbol *name);
	AW_Agent *FindAgent(char *name);

	float GetActTime(void) {return act_time;};
	float GetTimeRate(void) {return time_rate;};
	float GetMaxTimeInc(void) {return max_timestep;};

	List<Symbol> *GetAgentNames(void);

	void actualizeagentlist(void);
	void addagent(AW_Agent *a);
	void killagent(AW_Agent *a);

protected:

	void sense_agents(AW_Agent *agent,List<Symbol> *names,List<Vector> *poss,List<Vector> *dirs);

	AW_Scenario *scn;
	float act_time,time_rate,max_timestep;
	List<class AW_Agent> Agents;
	List<class AW_Agent> toadd;
	List<class AW_Agent> tokill;
	bool shadows;
	List<Vector> light_sources;
	Vector initial_camera,initial_camerap;
	Vector camera,camerap;

private:



}; /* AW_World */ 

#endif

